import 'package:flutter_deer/database/database_manager.dart';
import 'package:flutter_deer/database/tables.dart';
import 'package:flutter_deer/dl/dl.dart';
import 'package:rxdart/rxdart.dart';

abstract class BaseMdcControl {

  String mIP = '';
  int mPort = 0;

  final ObjectIdBox objectIdBox =getIt<ObjectIdBox>();

  void initAndStart(String pzIPv4, int uPort);

  void queryTTC(int chlNo);

  void refreshMachineTime();

  void clickCallBackNzlAll();

  void getAllPumpCode();

  void setGunPriceByGunNo(List<MdcSetPrcNzlCmdBeanPrcOil> list);

  void delThisMdc(String pzIPv4, int uPort);

  // 监听状态流
  final stateStreamController = BehaviorSubject<AppOrderBean>();

  // 监听订单流
  final orderStreamController = BehaviorSubject<AppOrderBean>();

  // 监听mdc链接状态
  final mdcStateStreamController = BehaviorSubject<MapEntry<String, bool>>();

  // 关闭流
  void dispose() {
    stateStreamController.close();
    orderStreamController.close();
    mdcStateStreamController.close();
  }
}

// 示例对应的 bean 类 MdcSetPrcNzlCmdBeanPrcOil（需根据实际的 Java 类定义来转换为 Dart 的类）
class MdcSetPrcNzlCmdBeanPrcOil {
  // 属性及方法
  int nzl = 0;
  int prc = 0;
}
